package com.ying.user.controller;

import com.ying.common.entity.Response;
import com.ying.user.service.MmVerifyCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping(value = "/mmVerifyCode")
public class MmVerifyCodeController {

    @Autowired
    private MmVerifyCodeService mmVerifyCodeService;

    @GetMapping("/verifyImage")
    public HttpEntity image() {
        HttpEntity response = mmVerifyCodeService.image();
        return response;

    }

    @PostMapping("/verifyCode")
    public Response imageVerify(@RequestParam String code) {
        Response response = mmVerifyCodeService.verify(code);
        return response;
    }

}
